package com.adcc.ags.cgw.configuration;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.sun.istack.NotNull;
import org.hibernate.validator.constraints.NotEmpty;

import javax.validation.constraints.Min;

/**
 * 网关配置工程
 */
public class GWFactory {

    @NotEmpty
    // 网关主机名称
    private String host;

    // 网关名称
    @NotEmpty
    private String name;

    // 上行报文长度限制
    @Min(0)
    private int uplinkMsgMaxLength;

    // DBForward
    private String dbForward;

    // MQ配置工厂
    @NotNull
    private MQFactory mqFactory;

    // 应急模式配置工厂
    private JobFactory emergencyFactory;

    // GMS配置工厂
    private JobFactory gmsFactory;

    // 心跳配置工厂
    @NotNull
    private HeartbeatFactory heartbeatFactory;

    /**
     * 构造函数
     */
    public GWFactory(){

    }

    @JsonProperty("host")
    public String getHost() {
        return host;
    }

    @JsonProperty("host")
    public void setHost(String host) {
        this.host = host;
    }

    @JsonProperty("name")
    public String getName() {
        return name;
    }

    @JsonProperty("name")
    public void setName(String name) {
        this.name = name;
    }

    @JsonProperty("uplinkMsgMaxLength")
    public int getUplinkMsgMaxLength() {
        return uplinkMsgMaxLength;
    }

    @JsonProperty("uplinkMsgMaxLength")
    public void setUplinkMsgMaxLength(int uplinkMsgMaxLength) {
        this.uplinkMsgMaxLength = uplinkMsgMaxLength;
    }

    @JsonProperty("dbForward")
    public String getDbForward() {
        return dbForward;
    }

    @JsonProperty("dbForward")
    public void setDbForward(String dbForward) {
        this.dbForward = dbForward;
    }

    @JsonProperty("mq")
    public MQFactory getMqFactory() {
        return mqFactory;
    }

    @JsonProperty("mq")
    public void setMqFactory(MQFactory mqFactory) {
        this.mqFactory = mqFactory;
    }

    @JsonProperty("heartbeat")
    public HeartbeatFactory getHeartbeatFactory() {
        return heartbeatFactory;
    }

    @JsonProperty("heartbeat")
    public void setHeartbeatFactory(HeartbeatFactory heartbeatFactory) {
        this.heartbeatFactory = heartbeatFactory;
    }

    @JsonProperty("emergency")
    public JobFactory getEmergencyFactory() {
        return emergencyFactory;
    }

    @JsonProperty("emergency")
    public void setEmergencyFactory(JobFactory emergencyFactory) {
        this.emergencyFactory = emergencyFactory;
    }

    @JsonProperty("gms")
    public JobFactory getGmsFactory() {
        return gmsFactory;
    }

    @JsonProperty("gms")
    public void setGmsFactory(JobFactory gmsFactory) {
        this.gmsFactory = gmsFactory;
    }
}
